home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / ghostscript / src / ivmspace.h < prev    next >
C/C++ Source or Header  |  1994-08-01  |  2KB  |  55 lines

  1. /* Copyright (C) 1992 Aladdin Enterprises.  All rights reserved.
  2.  
  3. This file is part of Ghostscript.
  4.  
  5. Ghostscript is distributed in the hope that it will be useful, but
  6. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  7. to anyone for the consequences of using it or for whether it serves any
  8. particular purpose or works at all, unless he says so in writing.  Refer
  9. to the Ghostscript General Public License for full details.
  10.  
  11. Everyone is granted permission to copy, modify and redistribute
  12. Ghostscript, but only under the conditions described in the Ghostscript
  13. General Public License.  A copy of this license is supposed to have been
  14. given to you along with Ghostscript so you can know your rights and
  15. responsibilities.  It should be in a file named COPYING.  Among other
  16. things, the copyright notice and this notice must be preserved on all
  17. copies.  */
  18.  
  19. /* ivmspace.h */
  20. /* Local/global space management */
  21.  
  22. /*
  23.  * Attempting to store a reference to a local object into a global object
  24.  * must produce an invalidaccess error.  We must check this in three
  25.  * categories of places:
  26.  *
  27.  *    - The scanner, when it encounters a //name inside {}.
  28.  *
  29.  *    - All operators that allocate ref-containing objects and also
  30.  *    store into them:
  31.  *        packedarray  gstate  makepattern?
  32.  *        makefont  scalefont  definefont
  33.  *
  34.  *    - All operators that store refs into existing objects:
  35.  *        put(array)  putinterval  astore  copy(to array)
  36.  *        def  store  put(dict)  copy(dict)
  37.  *        dictstack  execstack  makeoperator
  38.  *        currentgstate  defineusername?
  39.  */
  40.  
  41. /* Test whether an object is local/global. */
  42. #define r_local(rp) (r_type_attrs(rp) & a_local)
  43. #define r_is_local(rp) r_has_attr(rp, a_local)
  44. #define r_is_global(rp) !r_is_local(rp)
  45. #define check_global(rf)\
  46.   if ( !r_is_global(&rf) ) return_error(e_invalidaccess)
  47.  
  48. /* Get the local/global attribute of the current allocator, */
  49. /* either 0 or a_local. */
  50. extern uint alloc_current_local(P0());
  51.  
  52. /* Select the current local or global allocator. */
  53. /* Return the previous state. */
  54. extern uint alloc_select_local(P1(uint));
  55.